/**
 * 手机号格式验证
 */
export const isMobile = (str = '') => {
  const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
  return str.match(reg)
}

/**
 * 邮箱格式验证
 */
export const isEmail = (str = '') => {
  const reg =
    /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
  return str.match(reg)
}
